import service from "@/request/index.js";
import { _postForm } from "@/api/cms/request";

// 获取列表
export const getArticleListApi = (dataForm: any) => {
	return service.post('/api/cms/content/console/list', dataForm)
}
// 提交
export const submitArticleApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.post('/api/cms/content/edit', dataForm)
	} else {
		return service.post('/api/cms/content/save', dataForm)
	}
}
// 获取详情
export const getArticleInfoApi = (dataForm: any) => {
	return service.post('/api/cms/content/info', dataForm)
}
// 批量操作： 删除DEL  发布PUBLISH
export const batchArticleApi = (dataForm: any) => {
	return service.post('/api/cms/content/batch', dataForm)
}

// 上传图片
export const uploadImgApi = (params) => _postForm((window as any).globalUrl.url + '/cms/files/upload', params); 

// 修改内容状态  文章审核通过SUCCESS/回退BACK
export const articleAuditApi = (dataForm: any) => {
	return service.post('/api/cms/content/audit', dataForm )
}

// 撤回发布
export const articleStopApi = (dataForm: any) => {
	return service.post('/api/cms/content/cancel', dataForm)
}
